package cc.comac.mom.api;

import java.io.IOException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import cc.comac.mom.bean.EquipSparePartMasterData;
import cc.comac.mom.bean.ResultDev;
import cc.comac.mom.util.ResultBean;

@FeignClient(name = "mom-equipment-mgmt-srv")
public interface EquipSparePartMasterDataService {
	
	@RequestMapping(value = "/p/cs/EquipSparePartMasterDataService/insertSaprePartMasterData",method = RequestMethod.POST)
	public ResultBean insertSaprePartMasterData(@RequestBody EquipSparePartMasterData equipSparePartMasterData);
	
	@RequestMapping(value = "/p/cs/EquipSparePartMasterDataService/updateSparePart",method = RequestMethod.POST)
	public ResultBean updateSparePart(@RequestBody EquipSparePartMasterData equipSparePartMasterData);
	
	@RequestMapping(value = "/p/cs/EquipSparePartMasterDataService/batchDelete",method = RequestMethod.POST)
	public ResultBean batchDelete(@RequestBody List<EquipSparePartMasterData> list);
	
	@RequestMapping(value = "/p/cs/EquipSparePartMasterDataService/selectBysomeField",method = RequestMethod.POST)
	public ResultDev selectBysomeField(@RequestBody EquipSparePartMasterData equipSparePartMasterData);
	
	@RequestMapping(value = "/p/cs/EquipSparePartMasterDataService/selectBysparePartNumber",method = RequestMethod.POST)
	public ResultBean selectBysparePartNumber(@RequestBody EquipSparePartMasterData equipSparePartMasterData);

	@RequestMapping(value = "/p/cs/EquipSparePartMasterDataService/selectByWarehouseName",method = RequestMethod.POST)
	public ResultDev selectByWarehouseName (@RequestBody EquipSparePartMasterData equipSparePartMasterData);
	
	@RequestMapping(value = "/p/cs/EquipSparePartMasterDataService/selectByWarehouseNameAndSpareNumber",method = RequestMethod.POST)
	public ResultBean selectByWarehouseNameAndSpareNumber(@RequestBody EquipSparePartMasterData equipSparePartMasterData);
	
	@RequestMapping(value = "/p/cs/EquipSparePartMasterDataService/importSparePartMasterData",consumes = MediaType.MULTIPART_FORM_DATA_VALUE,method = RequestMethod.POST)
	ResultBean importSparePartMasterData(@RequestPart("file") MultipartFile file,@RequestParam(value = "rootPath") String rootPath)throws IOException;
	
	@RequestMapping(value = "/p/cs/EquipSparePartMasterDataService/exportData",method = RequestMethod.POST)
	String exportData(@RequestParam(value = "request") HttpServletRequest request, @RequestParam(value = "response") HttpServletResponse response,@RequestBody EquipSparePartMasterData obj);
	
}
